#ifndef MAINCORE_H
#define MAINCORE_H

#include <QObject>
#include <QSet>
#include <QMap>
#include <QHostAddress>
#include "remoteserver.h"
#include "captureserver.h"

class MainCore : public QObject
{
    Q_OBJECT
public:
    explicit MainCore(QObject *parent = nullptr);
    void addWid(int wid);
    bool listen(const QHostAddress &address, quint16 port);
signals:

protected slots:
    void on_receivedFramebuffer(const QByteArray &buff);
    void on_receivedMouse(int wid, int key, bool isPress, int x, int y);
    void on_receivedWheel(int wid, int delta);
    void on_receivedKey(int wid, int key, bool isPress);
private:
    QSet<int> m_widSet;
    QMap<int, CaptureServer*> m_widScreenMap;
    RemoteServer *server;
};

#endif // MAINCORE_H
